building websocket app with javascript